﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Alogient.Cameleon.Sdk.Items
{
    [Serializable]
    public class CMPageCollection : List<CMPage>
    {
        public CMPage GetPage(int navID)
        {
            var pages = this.Where(p => p.NavID == navID);

            if (pages.Count() == 0)
            {
                return null;
            }

            return pages.First();
        }

        public bool Exists(int navID)
        {
            return this.Where(p => p.NavID == navID).Count() > 0;
        }
    }
}
